package cjm.task5.mapper;

import cjm.task5.pojo.Record;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RecordMapper {
    void addRecord(Record record);

    List<Record> findRecordByOneUid(Integer id);

    List<Record> findRecordAll();

    List<Record> searchOneUserRecord(@Param("uid")Integer uid, @Param("keyword")String keyword);

    List<Record> searchAllRecord(@Param("keyword")String keyword);

    //判断今天是否打卡
    int todaySubmit(Integer id);
    //通过uid获取已打卡日期
    List<String> getAllDateByUid(Integer id);
    //通过日期查找打卡记录
    Record getRecordByDateAndUid(String date,Integer uid);

    List<Record> overTemperature();

    //上传记录排序
    List<Record> RecordOrderBy(@Param("id")Integer id,@Param("orderId")Integer orderId);

    //查询所有打卡记录（模糊查询和排序）
    List<Record> getRecordByKeyAndOrder(@Param("keyword")String keyword,
                                        @Param("id")Integer id,@Param("orderId")Integer orderId);
}
